package com.coda.app.service.impl;

import com.coda.app.mapper.PaymentTypeMapper;
import com.coda.app.service.PaymentTypeService;
import com.coda.entity.PaymentType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Service
public class PaymentTypeServiceImpl implements PaymentTypeService {

    @Autowired
    private PaymentTypeMapper paymentTypeMapper;
    /**
     * 获取全部支付方式
     * @return
     */
    @Override
    public List<PaymentType> getPaymentTypeList() {
        List<PaymentType> paymentTypeList = paymentTypeMapper.getPaymentList();
        return paymentTypeList;
    }

    /**
     * 根据房间id获取可选支付方式
     * @param id
     * @return
     */
    @Override
    public List<PaymentType> getListPayment(Long id) {
        List<PaymentType> roomPaymentList = paymentTypeMapper.getRoomPaymentList(id);
        return roomPaymentList;
    }
}
